from machine import Pin,PWM
led = Pin(2,Pin.OUT)
led_pwm=PWM(led)
led_pwm.freq(1)
led.duty(255)